Add a cast to avoid compiler warnings.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 30 Aug 2005 15:07:12 +0000 (15:07 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 30 Aug 2005 15:07:12 +0000 (15:07 +0000)
2005-08-30  Matthias Clasen  <mclasen@redhat.com>

* io-png.c (png_save_to_callback_write_func): Add a cast
to avoid compiler warnings.

* pixops/timescale.c (main): Declare src_buf, dest_buf as
unsigned to avoid compiler warnings.

* gdk-pixbuf-io.h: Declare the prefix and mask members of
GdkPixbufModulePattern as char*, to avoid compiler warnings.

* io-ani.c (ani_load_chunk): Use g_try_new() in some places.

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-io.c
gdk-pixbuf/gdk-pixbuf-io.h
gdk-pixbuf/io-ani.c
gdk-pixbuf/io-png.c
gdk-pixbuf/pixops/timescale.c

index 7fb50a1dfdb1d5f92be264e4bef7f34414bc856b..b18e30f3866e74119aa87ba19fcaeb8f8a67b443 100644 (file)
@@ -1,3 +1,16 @@
+2005-08-30  Matthias Clasen  <mclasen@redhat.com>
+
+       * io-png.c (png_save_to_callback_write_func): Add a cast
+       to avoid compiler warnings.
+
+       * pixops/timescale.c (main): Declare src_buf, dest_buf as
+       unsigned to avoid compiler warnings.
+
+       * gdk-pixbuf-io.h: Declare the prefix and mask members of
+       GdkPixbufModulePattern as char*, to avoid compiler warnings.
+
+       * io-ani.c (ani_load_chunk): Use g_try_new() in some places.
+
 2005-08-24  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.8.2 ===
index f67dd0355ccdea4aad23dc65f30d9043c051e651..b330ea5efa6d860b37f741fb9458469e55bb3ac6 100644 (file)
@@ -52,7 +52,7 @@ format_check (GdkPixbufModule *module, guchar *buffer, int size)
        gchar m;
        GdkPixbufModulePattern *pattern;
        gboolean anchored;
-       guchar *prefix, *mask;
+       gchar *prefix, *mask;
 
        for (pattern = module->info->signature; pattern->prefix; pattern++) {
                if (pattern->mask && pattern->mask[0] == '*') {
index e64bee7e0fede1365a28b5e0947741ae3a23325f..3fe9226c9ee5f48b4b282e03f456871dd14dce00 100644 (file)
@@ -75,8 +75,8 @@ typedef void (* GdkPixbufModuleUpdatedFunc)  (GdkPixbuf *pixbuf,
 
 typedef struct _GdkPixbufModulePattern GdkPixbufModulePattern;
 struct _GdkPixbufModulePattern {
-       unsigned char *prefix;
-       unsigned char *mask;
+       char *prefix;
+       char *mask;
        int relevance;
 };
 
index 5568ad65d445a706c68d91d5ee66f580bab98dc5..dd0ad7e40da5b35f655a7217ec171ef123caf52e 100644 (file)
@@ -366,12 +366,10 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
                context->animation->width = 0;
                context->animation->height = 0;
 
-               context->animation->pixbufs = (GdkPixbuf**) g_try_malloc (sizeof (GdkPixbuf*) * context->NumFrames);
-               if (context->animation->pixbufs) 
-                       memset (context->animation->pixbufs, 0, sizeof (GdkPixbuf*) * context->NumFrames);
-                                                
-               context->animation->delay = (guint32*) g_try_malloc (sizeof (guint32) * context->NumSteps);
-               context->animation->sequence = (guint32*) g_try_malloc (sizeof (guint32) * context->NumSteps);
+               context->animation->pixbufs = g_try_new0 (GdkPixbuf*, context->NumFrames);
+               context->animation->delay = g_try_new (gint, context->NumSteps);
+               context->animation->sequence = g_try_new (gint, context->NumSteps);
+
                if (!context->animation->pixbufs || 
                    !context->animation->delay || 
                    !context->animation->sequence) 
@@ -442,7 +440,7 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
                        return FALSE;
                }
                context->title[context->chunk_size] = 0;
-               read_int8 (context, context->title, context->chunk_size);
+               read_int8 (context, (guchar *)context->title, context->chunk_size);
 #ifdef DEBUG_ANI
                g_print ("INAM %s\n", context->title);
 #endif
@@ -461,7 +459,7 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
                        return FALSE;
                }
                context->author[context->chunk_size] = 0;
-               read_int8 (context, context->author, context->chunk_size);
+               read_int8 (context, (guchar *)context->author, context->chunk_size);
 #ifdef DEBUG_ANI
                g_print ("IART %s\n", context->author);
 #endif
index 25a2bb6060340f5078c77b5e7e506c0eb2e79fc1..deab99ae126866f668bcfe04e2590cfdc528f966 100644 (file)
@@ -754,7 +754,7 @@ png_save_to_callback_write_func (png_structp png_ptr,
 {
         SaveToFunctionIoPtr *ioptr = png_get_io_ptr (png_ptr);
 
-        if (!ioptr->save_func (data, length, ioptr->error, ioptr->user_data)) {
+        if (!ioptr->save_func ((gchar *)data, length, ioptr->error, ioptr->user_data)) {
                 /* If save_func has already set an error, which it
                    should have done, this won't overwrite it. */
                 png_error (png_ptr, "write function failed");
index a7fffc48860f0cff9a29dca144c4027d295a7205..945cf8003e3562ebdbddfa8c7243429a3fb64525 100644 (file)
@@ -118,7 +118,7 @@ dump_array (double times[3][3][4])
 int main (int argc, char **argv)
 {
   int src_width, src_height, dest_width, dest_height;
-  char *src_buf, *dest_buf;
+  unsigned char *src_buf, *dest_buf;
   int src_index, dest_index;
   int i;
   double scale_times[3][3][4];